<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/11/26
 * Time: 16:21
 */
function checkUsername($username){
    if(!preg_match('/^[\w\x{4e00}-\x{9fa5}]{2,10}$/',$username)){
        return '用户名格式不符合要求';
    }
    return true;
}
function checkPassword($password){
    if(!preg_match('/^\w{6,16}$/',$password)){
        return '密码格式不符合要求';
    }
    return true;
}
function checkEmali($email){
    if(strlen($email)>40){
        return '邮箱长度不合法';
    }elseif (!preg_match('/^[a-z0-9]+@([a-z0-9]+\.)+[a-z]{a-z}$/i',$email)){
        return '邮箱格式不符合要求';
    }
    return true;
}